Infrared learning device

ABSTRACT

An infrared (IR) learning device is disclosed. A hardware device of the IR learning device amplifies, shapes, and samples an IR signal to acquire a better digital signal related to the IR signal. A software device of the IR learning device calculates the waveform of the IR signal and the frequency of a carrier wave of the IR signal according to the digital signal related to the IR signal. Accordingly, the IR learning device can learn the IR signal emitted from an external device by the hardware device and the software device.

BACKGROUND 1. Technical Field

The present disclosure relates to an IR learning device, in particular,to an IR learning device which can learn a frequency and a waveform ofan IR signal.

2. Description of Related Art

As technology advances, a conventional universal remote controller canbe used to control various electronic devices. The conventionaluniversal remote controller stores IR signals corresponding toelectronic devices of different brands in advance. When a user controlsthe electronic devices of a specific brand with the conventionaluniversal remote controller, the IR signal corresponding to the brand ofthe electronic device is transmitted to control the electronic device.

However, when the IR signal corresponding to a specific brand is notpre-stored in the conventional universal remote controller, the userwill not be able to control the electronic device of the specific brandwith the universal remote controller. Therefore, the universal remotecontroller can only control electronic devices of specific brands withIR signals, and cannot truly be universally applied to any electronicdevice.

SUMMARY

The invention is to provide an IR learning device. A hardware device ofthe IR learning device amplifies, shapes, and samples an IR signal toacquire a better digital signal related to the IR signal. Next, asoftware device of the IR learning device calculates the waveform of theIR signal and the frequency of a carrier wave of the IR signal accordingto the digital signal related to the IR signal. Accordingly, the IRlearning device can learn the IR signal emitted from an external deviceby the hardware device and the software device.

An exemplary embodiment of the present disclosure provides an infrared(IR) learning device. The IR learning device is adapted for learning anIR signal emitted from an external device. The IR signal includes acarrier region having a carrier wave, and a no-carrier region. The IRlearning device includes an IR transceiver, an amplifying and shapingcircuit, a sampling circuit, and a processor. The IR transceiver isconfigured for receiving the IR signal. The amplifying and shapingcircuit is coupled to the IR transceiver. The amplifying and shapingcircuit is configured for amplifying and shaping the IR signal togenerate a digital signal related to the IR signal. The sampling circuitis coupled to the amplifying and shaping circuit. The sampling circuitis configured for sampling the digital signal once every period, andperforming a level switching record on the digital signal to generate alevel switching time of a level conversion of the digital signal. Theprocessor is coupled to the sampling circuit and the IR transceiver. Theprocessor is configured for executing the following steps: determiningwhether a level switching time is received; when the level switchingtime is received, calculating a time interval between the two adjacentlevel switching times; accumulating the time interval in a carrier timeof the carrier region or in a no-carrier time of the no-carrier region;and determining whether an end time has been reached. If the end timehas not been reached, the processor returns to the step of determiningwhether the level switching time is received. When the end time has beenreached, a waveform of the IR signal and a frequency of the carrier waveof the carrier region is calculated according to the carrier time, theno-carrier time, and a half-period number of the carrier wave.

In order to further understand the techniques, means and effects of thepresent disclosure, the following detailed descriptions and appendeddrawings are hereby referred to, such that, and through which, thepurposes, features and aspects of the present disclosure can bethoroughly and concretely appreciated; however, the appended drawingsare merely provided for reference and illustration, without anyintention to be used for limiting the present disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings are included to provide a furtherunderstanding of the present disclosure, and are incorporated in andconstitute a part of this specification. The drawings illustrateexemplary embodiments of the present disclosure and, together with thedescription, serve to explain the principles of the present disclosure.

FIG. 1 shows a relation diagram among an external device, an IR learningdevice, and a controlled device according to an embodiment of thepresent disclosure;

FIG. 2 shows a diagram of an IR learning device according to anembodiment of the present disclosure;

FIG. 3 shows a diagram of an amplifying and shaping circuit according toan embodiment of the present disclosure;

FIG. 4 shows a flowchart of a processor according to an embodiment ofthe present disclosure;

FIG. 5 shows a detailed flowchart of step S430 according to anembodiment of the present disclosure; and

FIG. 6 shows a wave diagram of a digital signal according to anexemplary embodiment of the present disclosure.

DESCRIPTION OF THE EXEMPLARY EMBODIMENTS

Reference will now be made in detail to the exemplary embodiments of thepresent disclosure, examples of which are illustrated in theaccompanying drawings. Wherever possible, the same reference numbers areused in the drawings and the description to refer to the same or likeparts.

Firstly, please refer to FIG. 1, which shows the relation diagram amongan external device, an infrared learning device, and a controlled deviceaccording to an embodiment of the present disclosure. As shown in FIG.1, an external device 50 emits an infrared signal IR to control acontrolled device 60. The infrared learning device 100 learns theinfrared signal IR emitted from the external device 50. After thelearning of the infrared signal IR is completed, the infrared learningdevice 100 can emit the same infrared signal IR as the external device50 to control the controlled device 60. In the present disclosure, theexternal device 50 is a remote controller emitting the infrared signalIR with the specific frequency. The controlled device 60 is a liquidcrystal display (LCD) TV. The LCD TV is controlled by the infraredsignal IR with the specific frequency. In the present disclosure, theinfrared learning device 100 is a universal remote controller that isused to integrate the infrared signals of the controlled device 60 andother controlled devices (not shown in FIGs). Therefore, the controlleddevice 60 and the other controlled devices may controlled by theinfrared learning device 100 without using multiple remote controls. Itshould be noted that the external device 50, the infrared learningdevice 100, and the controlled device 60 can be integrated into otherelectronic products and is not limited to that disclosed herein.

Next, please refer to FIG. 2, which shows the diagram of an IR learningdevice according to an embodiment of the present disclosure. As shown inFIG. 2, the infrared learning device 100 includes an infraredtransceiver 110, an amplifying and shaping circuit 120, a samplingcircuit 130, and a processor 140. The infrared transceiver 110 iscoupled to the processor 140, and receives the infrared signal IRemitted from the external device 50.

In the present disclosure, the infrared transceiver 110 has a transitionhole (not shown in FIGs). The processor 140 controls the infraredtransceiver 110 transmitting or receiving the infrared signal IR.Therefore, when the processor 140 controlling the infrared transceiver110 indicates a reception mode, the infrared transceiver 110 receivesthe infrared signal IR emitted from the external device 50 by thetransition hole to learn the infrared signal IR.

The amplifying and shaping circuit 120 is coupled to the infraredtransceiver 110. The received infrared signal IR is an analog signal.Therefore, the amplifying and shaping circuit 120 amplifies and shapesthe infrared signal IR to generate a digital signal SD related to theinfrared signal IR. Please refer to FIG. 6 in conjunction with FIG. 2.FIG. 6 shows a wave diagram of a digital signal according to anexemplary embodiment of the present disclosure. The digital signal SD isthe infrared signal IR in digital form, and is a square-wave signal. Thedigital signal SD includes a carrier region Ra and a no-carrier regionRb. However, the noise may present in no-carrier region and may causeerroneous determination at receiving site. The carrier region Ra has acarrier wave Cw.

In the present disclosure, the amplifying and shaping circuit 120includes an amplifying circuit 122 and a shaping circuit 124. Theamplifying circuit 122 includes an NPN transistor Q1 and resistors R1,R2, R3. The collect end of the NPN transistor Q1 receives a voltage Vinthrough the resistor R1. The emit end of the NPN transistor Q1 isconnected to the ground through the resistor R3. The base end of the NPNtransistor Q1 receives the infrared signal IR. The resistor R2 iselectrically connected between the base end and the collect end.Therefore, the NPN transistor Q1 amplifies the infrared signal IRaccording to the relationship among the resistors R1-R3, and thengenerates an infrared amplifying signal So to the shaping circuit 124.

The shaping circuit 124 includes a comparator CP1 and resistors R4 andR5. The non-inverting input end of the comparator CP1 is coupled to thecollect end of the NPN transistor Q1 through the resistor R4 to receivethe infrared amplifying signal So. The resistor R5 is electricallyconnected between the non-inverting input node of the comparator CP1 andthe output end of the comparator CP1. The inverting input node of thecomparator CP1 receives a reference voltage Vr. Therefore, thecomparator CP1 compares the infrared amplifying signal So and thereference voltage Vr, to shape the infrared signal IR in the analog forminto the digital signal SD. A person of ordinary skill in the art mayalso use other circuit architectures to form the amplifying and shapingcircuit 120, and the present disclosure is not limited in this respect.

The amplified and shaped digital signal SD may be distorted, so that theduty cycle of each cycle is different. This may cause each of thedigital signals SD to have at least one duty cycle. In order to avoidthe occurrence of distortion, the amplifying and shaping circuit 120 iscoupled to the sampling circuit 130. The sampling circuit 130 samplesthe digital signal SD once every period, and performs a level switchingrecord on the digital signal SD to generate a level switching time whenthe digital signal SD has a level conversion. Since a person of ordinaryskill in the art should be familiar with the periodical sampling of thedigital signal SD, detailed description thereof is omitted. As shown inFIG. 6, the sampling circuit 130 generates level switching times I0, I1,I2, I3 . . . I_(n−1), I_(n), I_(n+1) . . . I_(m), I_(m+1), I_(m+2),I_(m+3), I_(m+4), I_(m+5), I_(m+6), I_(m+7) . . . I_(p), I_(p+1) . . .of the digital signal SD to the processor 140.

The processor 140 is coupled to the sampling circuit 130 and theinfrared transceiver 110, and is configured for executing the followingsteps so as to learn the infrared signal IR according to the receivedlevel switching times. For the sake of convenience, the followingdescription is based on the circumstance that the processor 140 ignoreswhether the infrared signal IR contains noise. Referring to FIGS. 4 and6, firstly, the processor 140 determines whether the level switchingtime In transmitted from the sampling circuit 130 is received (stepS410). If the processor 140 determines that the level switching time Inhas not been received, the processor 140 proceeds to re-determinewhether the level switching time In has been received, i.e., returns tostep S410.

When the processor 140 determines that the level switching time In isreceived, the processor 140 calculates a time interval between the twoadjacent level switching times In (step S420). For example, when theprocessor 140 determines that the level switching time I1 is received,the processor 140 calculates the time interval T1 between the twoadjacent level switching times I1 and I0. When the processor 140determines that the level switching time I2 is received, the processor140 calculates the time interval T2 between the two adjacent levelswitching times I2 and I1.

The processor 140 then accumulates the time interval in the carrier timeTa of the carrier region Ra or accumulates the time interval in theno-carrier time Tb of the no-carrier region Rb (step S430). Morespecifically, please refer to FIG. 5, which shows a detailed flowchartof step S430 according to an embodiment of the present disclosure. Asshown in FIG. 5, after the processor 140 calculates the time intervalbetween the two adjacent level switching times In, the processor 140determines whether the time interval indicates a half-period time of thecarrier wave Cw to accordingly determine whether the signal of the timeinterval should be located in the carrier region Ra or in the no-carrierregion Rb (step S510). In the present disclosure, the half-period timeof the carrier wave Cw is a predefined time interval, e.g., 30-40 ms.

When the processor 140 determines that the time interval indicates thehalf-period time of the carrier wave Cw, the processor 140 accumulatesthe time interval in a continuous waveform duration time, and adds to atotal number of the half-period times by one (step S520). It is worthnoting that, in the carrier region Ra, the half-period time of thecarrier wave Cw is usually 30-40 ms. However, in the no-carrier regionRb, the time interval may be close to the half-period time of thecarrier wave Cw. Therefore, the continuous waveform duration time mayappear in the carrier region Ra or in the no-carrier region Rb. Forexample, as shown in FIG. 6, when the processor 140 determines that thelevel switching time I3 is received, the processor 140 calculates thetime interval T3 between the two adjacent level switching times I3 andI2, and determines whether the time interval T3 is a half-period time ofthe carrier wave Cw. When the processor 140 determines that the timeinterval T3 (e.g., 35 ms) is the half-period time (e.g., 30-40 ms) ofthe carrier wave Cw, the processor 140 accumulates the time interval T3in the continuous waveform duration time, and adds to a total number ofthe half-period times by one.

When the processor 140 determines that the time interval is not thehalf-period time of the carrier wave Cw, the processor 140 furtherdetermines whether the previous time interval is the half-period time ofthe carrier wave Cw (step S530). When the processor 140 determines thatthe previous time interval is not the half-period time of the carrierwave Cw, it indicates that the time interval is in the no-carrier regionRb. At this time, the processor 140 accumulates the time interval in anon-waveform duration time (step S550). The non-waveform duration timeappears in the no-carrier region Rb. With the time interval Tn+2 of FIG.6 as an example, when the processor 140 determines that the previoustime interval T_(n+1) is not the half-period time of the carrier waveCw, it indicates that the time interval T_(n+2) is in the no-carrierregion Rb. The processor 140 accumulates the time interval T_(n+2) inthe non-waveform duration time.

When the processor 140 determines that the previous time interval is thehalf-period time of the carrier wave Cw, the processor 140 furtherdetermines whether the continuous waveform duration time indicates anoise (step S540). In the present disclosure, when the continuouswaveform duration time is less than a predefined time (e.g., 300 ms),the processor 140 determines that the continuous waveform duration timeindicates the noise. Conversely, when the continuous waveform durationtime is more than or equal to the predefined time, the processor 140determines that the continuous waveform duration time does not indicatethe noise. At this time, the continuous waveform duration time indicatesthe carrier time Ta of the carrier region Ra. When the processor 140determines that the continuous waveform duration time indicates thenoise, it indicates that the continuous waveform duration time is in theno-carrier region Rb. At this time, the processor 140 accumulates thetime interval and the continuous waveform duration time in theno-carrier time Tb (step S560). As shown in FIG. 6, under the exemplaryconditions that the time interval is T_(m+5), the accumulated continuouswaveform duration time is 150 ms, and the predefined time is 300 ms,when the processor 140 determines that the previous time intervalT_(m+4) is the half-period time of the carrier wave Cw, the processor140 further determines that the continuous waveform duration timeindicates the noise (i.e., determines that the continuous waveformduration time (150 ms) is less than the predefined time (300 ms)), itindicates that the time interval T_(m+5) and the accumulated continuouswaveform duration time are in the no-carrier region Rb. At this time,the processor 140 accumulates the time interval T_(m+5) and theaccumulated continuous waveform duration time in the no-carrier regionRb. Accordingly, when there is the noise in the no-carrier region Rb,the processor 140 can remove the interference from the noise.

If the processor 140 determines that the continuous waveform durationtime does not indicate the noise, it indicates that the continuouswaveform duration time is the carrier time Ta of the carrier region Ra.At this time, the processor 140 takes the continuous waveform durationtime as the carrier time Ta of the carrier region Ra, takes thenon-waveform duration time as the no-carrier time Tb of the no-carrierregion Rb, takes the total number as the half-period number of thecarrier wave Cw, and resets the continuous waveform duration time, thenon-waveform duration time, and the total number (step S570). Afterresetting the continuous waveform duration time, the non-waveformduration time, and the total number, the processor 140 accumulates thetime interval in the non-waveform duration time to re-accumulate theno-carrier time Tb of the next period (step S580).

As shown in FIG. 6, under the exemplary conditions that the timeinterval is T_(n+1), the accumulated continuous waveform duration timeis 560 ms, and the predefined time is 300 ms as an example, when theprocessor 140 determines that the previous time interval Tn is thehalf-period time of the carrier wave Cw, the processor 140 furtherdetermines that the continuous waveform duration time does not indicatethe noise (i.e., determining that the continuous waveform duration time(560 ms) is more than or equal to the predefined time (300 ms)),indicating that the continuous waveform duration time is the carriertime Ta. At this time, the processor 140 takes the continuous waveformduration time as the carrier time Ta of the carrier region Ra, takes thenon-waveform duration time as the no-carrier time Tb of the no-carrierregion Rb, takes the total number as the half-period number, and thenresets continuous waveform duration time, the non-waveform durationtime, and the total number. Next, the processor 140 accumulates the timeinterval T_(n+1) in the non-waveform duration time to re-accumulate theno-carrier time Tb of the next period.

After the step S520, S550, S560, and S580, the processor 140 furtherdetermines whether an end time is reached to accordingly determinewhether to end the infrared learning (step S440). In the presentdisclosure, the end time can be set according to the actual condition ofthe digital signal SD to ensure that the processor 140 has acquired allwaveforms and frequencies within one period of the digital signal SD.Therefore, when the processor 140 determines that the end time (e.g.,2000 ms) has not been reached, the processor 140 returns to the step ofdetermining whether the level switching time In is received, i.e.,returns to step S410. Conversely, when the processor 140 determines thatthe end time (e.g., 2000 ms) has been reached, the processor 140 endsthe infrared learning (step S445). At this time, the processor 140calculates the waveform of the infrared signal IR and the frequency ofthe carrier wave Cw of the carrier region Ra according to the carriertime Ta, the no-carrier time Tb, and the half-period number of thecarrier wave Cw. More specifically, the processor 140 generates thecarrier time Ta of the carrier region Ra and the no-carrier time Tb ofthe no-carrier region Rb. The processor 140 takes the carrier time Taand the carrier time Tb as the waveform of the infrared signal and takesthe half-period number of the carrier wave Cw as the frequency of thecarrier wave Cw of the carrier region Ra to complete the learning of theinfrared signal IR accordingly.

Taking FIG. 6 as an example, FIG. 6 shows that the sampling circuit 130transmits the level switching time to the processor 140, so that theprocessor 140 learns the infrared signal IR under the condition that theinfrared signal IR has the noise. The half-period number of the carrierwave Cw is predefined to 30-40 ms. The end time is predefined to 2000ms. In the digital signal SD, the time intervals T₁˜T_(n) are 35 ms, thetime interval T_(n+1) is 150 ms, the time interval T_(n+2)˜T_(m) are 2.5ms, the time interval T_(m+1) is 150 ms, the time intervalT_(m+2)˜T_(m+4) are 35 ms, the time interval T_(m+5) is 150 ms, the timeinterval T_(m+6)˜T_(p) are 35 ms, and the time interval T_(p+1) is 150ms.

As shown in FIG. 6, the processor 140 firstly determines that the levelswitching time I₀ has been received. Since the processor 140 has notreceived other adjacent level switching times at this point, the timeinterval is 0 secs. The processor 140 determines that the time interval(i.e., 0 secs) is not the half-period time (i.e., 30-40 ms) of thecarrier wave Cw. Next, the processor 140 executes the steps S530 andS550 to accumulate the time interval (the present value is 0) in thenon-waveform duration time. Since the end time (i.e., 2000 ms) has notbeen reached, the processor 140 returns to the step S410.

Next, the processor 140 determines that the level switching time I₁ isreceived, the processor 140 calculates the time interval T₁ between twoadjacent level switching times I₁ and I₀, and determines that the timeinterval T₁ (i.e., 35 ms) is the half-period time (i.e., 30-40 ms) ofthe carrier wave Cw. The processor 140 then accumulates the timeinterval T1 (i.e., 35 ms) in the continuous waveform duration time, andadds to the total number of the half-period times by one. At this time,the accumulated continuous waveform duration time is the time intervalT1 and the total number of the half-period time is 1. Since the end time(i.e., 2000 ms) has not been reached, the processor 140 returns to stepS410.

Next, the processor 140 equally receives the level switching times I₂,I₃ . . . I_(n) to execute the steps S410, S420, S510, S520 and S440. Atthis time, the accumulated continuous waveform duration time is timeintervals T₁+T₂+T₃+ . . . +T_(n), and the total number of thehalf-period times is n. Equally, since the end time (i.e., 2000 ms) hasnot been reached, the processor 140 returns to step S410.

Next, the processor 140 determines that the level switching time I_(n+1)is received, the processor 140 calculates the time interval T_(n+1)between the two adjacent level switching times I_(n+1) and I_(n), anddetermines that the time interval T_(n+1) (i.e., 150 ms) is not thehalf-period time (i.e., 30-40 ms) of the carrier wave Cw. The processor140 then determines that the previous time interval T_(n) is thehalf-period time of the carrier wave Cw, and determines that thecontinuous waveform duration time does not indicate the noise. Thismeans that the continuous waveform duration time is the carrier time Taand the time interval Tn+1 is in the first no-carrier time Tb. At thistime, the processor 140 takes the continuous waveform duration time(i.e., T₁+T₂+T₃+ . . . +T_(n)) as the carrier time Ta of the carrierregion Ra, takes the non-waveform duration time as the no-carrier timeTb of the no-carrier region Rb, takes the total number (i.e., the totalnumber is n) as the half-period number of the carrier waveform Cw, andresets the continuous waveform duration time, the non-waveform durationtime, and the total number. Next, the processor 140 accumulates the timeinterval T_(n+1) in the non-waveform duration time to re-accumulate theno-carrier time Tb of the next period. Then, the processor 140 returnsto the step S410.

Next, the processor 140 sequentially determines that the time intervalsT_(n+2) . . . T_(m), T_(m+1) are not the half-period time of the carrierwave Cw, and the previous time interval is not the half-period time, tosequentially accumulate the time intervals T_(n+2) . . . T_(m), T_(m+1)in the non-waveform duration time. Then the processor 140 returns to thestep S410.

Next, the processor 140 determines that the time intervalsT_(m+2)-T_(m+4) are the half-period time of the carrier wave Cw tosequentially accumulate the time intervals T_(m+2)-T_(m+4) in thecontinuous waveform duration time, and to sequentially add to the totalnumber of the half-period times (i.e., the total number is 3). Then theprocessor 140 returns to the step S410. Next, the processor 140determines that the time interval T_(m+5) (i.e., 150 ms) is not thehalf-period time of the carrier wave Cw, and that the previous timeinterval T_(m+4) (i.e., 35 ms) is the half-period time (i.e., 30-40 ms).At this time, the processor 140 further determines that the continuouswaveform duration time indicates the noise (i.e., determines that thecontinuous waveform duration time (105 ms) is less than the predefinedtime (300 ms)), and accumulates the time interval T_(m+5) and thecontinuous waveform duration time in the non-waveform duration time.Then, the processor 140 returns to the step S410.

Next, the processor 140 receives the level switching times I_(m+6),I_(m+7) . . . I_(p) to execute the steps S410, S420, S510, S520, andS440. At this time, the accumulated continuous waveform duration time istime intervals T_(m+6)+T_(m+7)+ . . . +T_(p), and the total number ofthe half-period times is (p)−(m+6). Then, the processor 140 returns tothe step S410.

Next, the processor 140 determines that the time interval T_(p+1) (i.e.,150 ms) is not the half-period time (i.e., 30-40 ms) of the carrier waveCw. The processor 140 determines that the previous time interval T_(p)is the half-period time of the carrier wave Cw and determines that thecontinuous waveform duration time does not indicate the noise. Thismeans that the continuous waveform duration time is the carrier time Taand the time interval T_(n+1) is in the first no-carrier time Tb. Atthis time, the processor 140 takes the continuous waveform duration time(i.e., T_(m+6)+T_(m+7)+ . . . +T_(p)) as the carrier time Ta of thecarrier region Ra, takes the non-waveform duration time as theno-carrier time Tb of the no-carrier region Rb, takes the total number(i.e., the total number is n) as the half-period number of the carrierwaveform Cw, and resets the continuous waveform duration time, thenon-waveform duration time, and the total number. Next, the processor140 accumulates the time interval T_(n+1) in the non-waveform durationtime to re-accumulate the no-carrier time Tb of the next period.

When the processor 140 determines that the end time (i.e., 2000 ms) hasbeen reached, the processor 140 will complete the learning of theinfrared signal IR. At this time, the processor 140 calculates awaveform of the infrared signal IR and a frequency of the carrier waveCw of the carrier region Ra according to the carrier time Ta, theno-carrier time Tb, and a half-period number of the carrier wave Cw(i.e., at least one carrier time Ta, at least one no-carrier time Tb,and at least one half-period number of the carrier wave Cw). Morespecifically, the processor 140 takes the carrier time Ta of the carrierregion Ra and the no-carrier time Tb of the no-carrier region Rb as thewaveform of the infrared signal IR. The processor 140 also takes thehalf-period number of the carrier wave Cw to calculate the frequency ofthe carrier wave Cw of the carrier region Ra so as to complete thelearning of the infrared signal IR.

After the learning of the infrared signal IR is completed, the infraredlearning device 100 will have the same infrared signal IR as theexternal device 50. At this time, the processor 140 can control theinfrared transceiver 110 and then transmit the infrared signal IRthrough the transition hole to remotely control the controlled device60.

In summary, the invention is to provide the infrared learning device.The hardware device (i.e., the amplifying and shaping circuit and thesampling circuit) of the infrared learning device amplifies, shapes, andsamples the infrared signal to acquire a better digital signal relatedto the infrared signal. Next, the software device (i.e., the processor)of the infrared learning device calculates the waveform of the infraredsignal and the frequency of the carrier wave of the infrared signalaccording to the digital signal related to the infrared signal.Accordingly, the infrared learning device can learn the infrared signalemitted from the external device by the hardware device and the softwaredevice.

The above-mentioned descriptions represent merely the exemplaryembodiment of the present disclosure, without any intention to limit thescope of the present disclosure thereto. Various equivalent changes,alterations or modifications based on the claims of present disclosureare all consequently viewed as being embraced by the scope of thepresent disclosure.

What is claimed is:
 1. An infrared (IR) learning device, adapted forlearning an IR signal emitted from an external device, the IR signalcomprising a carrier region and a no-carrier region, the carrier regionhaving a carrier wave, and the IR learning device comprising: an IRtransceiver for receiving the IR signal; an amplifying and shapingcircuit, coupled to the IR transceiver, for amplifying and shaping theIR signal to generate a digital signal related to the IR signal; asampling circuit, coupled to the amplifying and shaping circuit, forsampling the digital signal once every period, and performing a levelswitching record on the digital signal to generate a level switchingtime while the digital signal having a level conversion; and aprocessor, coupled to the sampling circuit and the IR transceiver, forexecuting the following steps: determining whether the level switchingtime is received; when the level switching time is received, calculatinga time interval between the two adjacent level switching times;accumulating the time interval in a carrier time of the carrier regionor in a no-carrier time of the no-carrier region; and determiningwhether an end time has been reached, wherein returning to the step ofdetermining whether the level switching time is received if the end timehas not been reached; and calculating a waveform of the IR signal and afrequency of the carrier wave of the carrier region according to thecarrier time, the no-carrier time and a half-period number of thecarrier wave if the end time has been reached.
 2. The IR learning deviceaccording to claim 1, wherein when determining that the level switchingtime is received, the processor re-determines whether the levelswitching time is received.
 3. The IR learning device according to claim1, wherein the step of accumulating the time interval in the carriertime of the carrier region or in the no-carrier time of the no-carrierregion, further comprises: determining whether the time interval is ahalf-period time of the carrier wave; when the time interval is thehalf-period time of the carrier wave, accumulating the time interval ina continuous waveform duration time, and adding to a total number of thehalf-period times by one; when the time interval is not the half-periodtime of the carrier wave, determining whether the previous time intervalis the half-period time; when the previous time interval is not thehalf-period time, accumulating the time interval in a non-waveformduration time, and when the previous time interval is the half-periodtime, determining whether the continuous waveform duration timeindicates a noise; when the continuous waveform duration time indicatesthe noise, accumulating the time interval and the continuous waveformduration time in the non-waveform duration time, and when the continuouswaveform duration time does not indicate the noise, taking thecontinuous waveform duration time as the carrier time of the carrierregion, taking the non-waveform duration time as the no-carrier time ofthe no-carrier region, taking the total number as the half-periodnumber, and resetting the continuous waveform duration time, thenon-waveform duration time, and the total number; and after resettingthe continuous waveform duration time, the non-waveform duration time,and the total number, accumulating the time interval in the non-waveformduration time.
 4. The IR learning device according to claim 3, whereinwhen the continuous waveform duration time is less than a predefinedtime, the processor determines that the continuous waveform durationtime indicates the noise.
 5. The IR learning device according to claim3, wherein when the continuous waveform duration time is more than orequal to a predefined time, the processor determines that the continuouswaveform duration time does not indicate the noise.
 6. The IR learningdevice according to claim 1, wherein the processor takes the carriertime of the carrier region and the no-carrier time of the no-carrierregion as the waveform of the IR signal, and takes the half-periodnumber of the carrier wave to calculate the frequency of the carrierwave of the carrier region.
 7. The IR learning device according to claim6, wherein the carrier time is less than the no-carrier time.
 8. The IRlearning device according to claim 6, wherein an upper half period ofthe carrier wave is equal to a lower half period of the carrier wave. 9.The IR learning device according to claim 1, wherein the IR transceiverhas a transition hole, and the processor controls the IR transceivertransmitting or receiving the IR signal.
 10. The IR learning deviceaccording to claim 1, wherein the digital signal is a square-wavesignal, and the square-wave signal has at least one duty cycle.